}
});
- global.display.connect('x11-display-opened', () => {
+ global.display.connect('init-xserver', (display, task) => {
IBusManager.getIBusManager().restartDaemon(['--xim']);
- Shell.util_start_systemd_unit('gnome-session-x11-services.target', 'fail');
+ Shell.util_start_systemd_unit('gsd-xsettings.target', 'fail');
+
+ /* Leave this watchdog timeout so don't block indefinitely here */
+ let timeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, () => {
+ Gio.DBus.session.unwatch_name(watchId);
+ task.return_boolean(false);
+ timeoutId = 0;
+ return GLib.SOURCE_REMOVE;
+ });
+
+ /* When gsd-xsettings daemon is started, we are good to resume */
+ let watchId = Gio.DBus.session.watch_name(
+ 'org.gnome.SettingsDaemon.XSettings',
+ Gio.BusNameWatcherFlags.NONE,
+ () => {
+ Gio.DBus.session.unwatch_name(watchId);
+ if (timeoutId > 0) {
+ task.return_boolean(true);
+ GLib.source_remove(timeoutId);
+ }
+ },
+ null);
+ return true;
});
- global.display.connect('x11-display-closing', () => {
- Shell.util_stop_systemd_unit('gnome-session-x11-services.target', 'fail');
+ global.display.connect('shutdown-xserver', (display, task) => {
+ Shell.util_stop_systemd_unit('gsd-xsettings.target', 'fail');
IBusManager.getIBusManager().restartDaemon();
+ task.return_boolean(true);
});
Main.overview.connect('showing', () => {